import tkinter as tk
from tkinter import ttk
from disclaimer_dialog import show_disclaimer_dialog
from attributes_tab import AttributesTab
from equipment_tab import EquipmentTab
from skills_tab import SkillsTab
from talents_tab import TalentsTab
from traits_tab import TraitsTab

class NumericalSimulator:
    def __init__(self, root):
        self.root = root
        self.root.title("数值模拟器")
        self.root.geometry("800x600")
        # bug修复: 检查免责声明对话框是否显示
        if show_disclaimer_dialog(self.root):  # 调用 show_disclaimer_dialog 函数
            self.create_main_interface()
        else:
            self.root.destroy()

    def create_main_interface(self):
        self.tab_control = ttk.Notebook(self.root)
        self.tab_control.pack(expand=1, fill="both")
        
        self.attributes_tab = AttributesTab(self.tab_control)
        self.tab_control.add(self.attributes_tab, text='属性预览')

        self.equipment_tab = EquipmentTab(self.tab_control)
        self.tab_control.add(self.equipment_tab, text='装备')

        self.skills_tab = SkillsTab(self.tab_control)
        self.tab_control.add(self.skills_tab, text='技能')

        self.talents_tab = TalentsTab(self.tab_control)
        self.tab_control.add(self.talents_tab,text='天赋')

        self.traits_tab = TraitsTab(self.tab_control)
        self.tab_control.add(self.traits_tab, text='特性')
        
if __name__ == "__main__":
    root = tk.Tk()
    app = NumericalSimulator(root)
    root.mainloop()